package page58;

public class Test4 {
    public static void main(String[] args) {
        int n = 1000;
        int i, j;
        int sum = 0;
        for (i = 1; i < n; i++) {
            for (j = 1; j < i; j++) {
                if (i % j == 0)
                    sum += j;
            }
            if (sum == i)
                System.out.println(i);
            sum = 0;
        }
    }
}
